#ifndef _MSN_COMMAND_H
#define _MSN_COMMAND_H
#include "msn_session.h"
enum msn_ns_command_type_t {
	MSN_NS_NONE = -1,
	MSN_NS_VER,
	MSN_NS_CVR,
	MSN_NS_USR,
	MSN_NS_XFR,
	MSN_NS_MSG,
	MSN_NS_BLP,
	MSN_NS_ADL,
	MSN_NS_PRP,
	MSN_NS_CHG,
	MSN_NS_UBX,
	MSN_NS_RNG,
	MSN_NS_CHL,
	MSN_NS_QRY,
	MSN_NS_QNG,
	MSN_NS_GCF,
};

enum msn_sb_command_type_t {
	MSN_SB_NONE = -1,
	MSN_SB_ANS,
	MSN_SB_MSG, 
	MSN_SB_BYE,
	MSN_SB_USR,
};

typedef struct {
	int id;
	char *name;
}msn_command_t;

extern int msn_ns_command_type_get(const char *line, const int line_size);
extern int msn_command_payload(const char *line, const int line_size);
extern int msn_sb_command_type_get(const char *line, const int size);
/* remaid to alloc passport and display */
extern void msn_sb_msg_parse(const char *line, const int size , \
				GString *passport, GString *display, int *payload);
/* some commands parse */
extern void msn_ns_adl_parse(const char *line, const int size, int *payload);
extern void msn_ns_qng_parse(const char *line, const int size, int *time);
extern void msn_ns_xfr_parse(const char *line, const int size, int *isns, char *ip, int *port);
extern void msn_ns_usr_parse(const char *line, const int size, char *nonce);
extern void msn_command_send(event_t *ev, int fd, void *arg, \
			   void (*cb) (int, int, int, void *),	const char *fmt, ...);
#endif
